<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
  <script type="text/javascript"> 
 	//以下为官方示例
   $().ready(function () {
       // validate the comment form when it is submitted
       // validate signup form on keyup and submit
   	   if((typeof validateConfig) == 'undefined'){
   			tagget = parent;
    	   validateConfig = {};
       }else if(validateConfig.messages){
	       appendIcon(validateConfig.messages);
       }
       $("#${actionID }Form").validate(validateConfig);
       $("#${actionID }Form input,#${actionID }Form select").each(function(){
    	   var temp = $(this);
    	  // alert(temp.attr("data-nostar"));
    	   if(!temp.is(":hidden") && !temp.attr("data-noStar") && (temp.attr("required") || 
    			   (validateConfig.rules && validateConfig.rules[temp.attr("name")] && validateConfig.rules[temp.attr("name")].required))){
	    	   $(this).parent().parent().append("<span style='position: absolute;right: 0;top: 0px;line-height: 45px;color: #ff0000;'>*</span>");
    	   }
       });
       
   });
 
    var icon = "<i class='fa fa-times-circle'></i> ";
 	function appendIcon(rule){
 		for(var temp in rule){
 			if(typeof rule[temp]=='string'){
 				rule[temp] = icon+rule[temp];
 			}else{
 				appendIcon(rule[temp]);
 			}
 		}
 	}
 	
   </script>

